//
// Created by Administrator on 2024/10/25.
//

#ifndef AI_PACS_HTTPSERVER_H
#define AI_PACS_HTTPSERVER_H


#include <iostream>
#include <memory>
#include <CivetServer.h>
#include "HandlerRegistrar.h"
#include "../constant/constant.h"
#include <unistd.h>

class HttpServer {
public:
    HttpServer();
    ~HttpServer();
    [[noreturn]] void run();
    [[nodiscard]] std::string getPort() const;

private:
    std::unique_ptr<CivetServer> m_server;
    std::string m_port;
    std::map<std::string, CivetHandler*> m_handlers;
};

#endif //AI_PACS_HTTPSERVER_H
